var current_genome = "dd";
var config = {
    'dd' : {
        genome_name: 'D. discoideum',
        tracks : {
        'gene_models': {
            name: 'Gene Models',
            id: 'gene_models',
            type: 'genome_tracks',
            always_show: true,
            height: 70,
            func: 'show_gene_models',
            url: 'http://purple.bioch.bcm.tmc.edu/~anup/RNAseq/RNA-seq-browser/ajax/get_tracks1.php',
            additional_params: {
                debug: 0,
                log: 0,
                flank: 0,
                genome:'dd',
                action: 'gene_model_track'
            },
            popups: [
                {
                    name:'DictyExpress',
                    //icon:'',
                    url: 'http://www.ailab.si/dictyexpress/run/index.php?username=rnaseq&password=rnaseq&gene={DBGENEID}'
                },
                {
                    name:'Dictybase',
                    icon:'images/dictybase.ico',
                    url: 'http://dictybase.org/gene/{DBGENEID}'
                }
            ],
            order: 1
        },
        'mapability':{
            name: 'Mapability',
            id: 'mapability',
            type: 'genome_tracks',
            label: 'Average Mapability',
            always_show: false,
            height: 30,
            url: 'http://purple.bioch.bcm.tmc.edu/~anup/RNAseq/RNA-seq-browser/ajax/get_tracks1.php',
            additional_params: {
                debug: 0,
                log: 0,
                flank: 0,
                genome:'dd',
                action: 'mapability'
            },
            func: 'show_coverage',
            order: 2
        },
        'summary':{
            name: 'Summary',
            id: 'summary',
            type: 'summary_tracks',
            label: 'Sum of Selected Samples',
            always_show: false,
            height: 50,
            process_function: 'summary',
            additional_params: {
                debug: 0,
                log: 0,
                genome:'dd',
                flank: 0,
                action: 'coverage'
            },
            func: 'show_coverage',
            order: 3
        },
        'coverage':{
            name: 'Coverage',
            id: 'coverage',
            type: 'sample_tracks',
            label: '',
            always_show: false,
            checked: true,
            height: 50,
            func: 'show_coverage',
            url: 'http://purple.bioch.bcm.tmc.edu/~anup/RNAseq/RNA-seq-browser/ajax/get_tracks1.php',
            additional_params: {
                debug: 0,
                log: 0,
                flank: 0,
                genome:'dd',                
                action: 'coverage'
            },
            order: 1
        },
        'splice': {
            name: 'Splice Junctions',
            id: 'splice',
            type: 'sample_tracks',
            label: '',
            always_show: false,
            checked: false,
            func: 'show_splice',
            url: 'http://purple.bioch.bcm.tmc.edu/~anup/RNAseq/RNA-seq-browser/ajax/get_tracks1.php',
            additional_params: {
                debug: 0,
                log: 0,
                flank: 0,
                genome:'dd',            
                action: 'splice'
            },
            order: 2
        }},
        samples: {
            url: 'http://purple.bioch.bcm.tmc.edu/~anup/RNAseq/RNA-seq-browser/ajax/get_tracks1.php',
        	//url: 'http://purple.bioch.bcm.tmc.edu/~anup/RNAseq/RNA-seq-browser/ajax/get_tracks1.php',
            additional_params: {
                action: 'get_samples',
                genome:'dd'                
            },
            columns: [
            {
                id: 'Id',
                header: "sample_id",
                width: 75,
                sortable: true,
                dataIndex: 'sample_id'
                
            },
            {
                header: "Strain",
                width: 75,
                sortable: true,
                dataIndex: 'strain'
            },
            {
                header: "Time Point",
                width: 75,
                sortable: true,
                dataIndex: 'time_point'
            },
            {
                header: "Bio Rep",
                width: 75,
                sortable: true,
                dataIndex: 'bio_replicate'
            },
            {
                header: "Tech Rep",
                width: 75,
                sortable: true,
                dataIndex: 'tech_replicate'
            },
            {
                header: "Growth Condition",
                width: 100,
                sortable: true,
                dataIndex: 'growth_condition'
            },
            {
                header: "Cell Type",
                width: 75,
                sortable: true,
                dataIndex: 'cell_type'
            },
            {
                header: "Total Reads",
                width: 75,
                sortable: true,
                dataIndex: 'norm_counts',
                hidden:true
            }]
        },
        search: {
            url: 'http://purple.bioch.bcm.tmc.edu/~anup/RNAseq/RNA-seq-browser/ajax/get_tracks1.php',
            additional_params: {
                action: 'search',
                genome:'dd'                
            },
            columns: [
            {
                id: 'location',
                header: "Location",
                sortable: false,
                dataIndex: 'location'
            }
            ]
        },
        helpText: {
            helpPanel: '<div><ul style="line-height:2em"><li>Click the <img src="images/Information.png" class="tip"/> icons for help.</li><li>A brief <a href="#" id="tutorial">Tutorial</a>.</li><li>Use <a target="_blank" href="http://code.google.com/p/tbrowse/">TBrowse</a> for your own data.</li></div>',
            searchTip: 'Search by gene name, DDB_G, or location (1:1231..12312).<br>Use * as a wildcard character.<br>Examples: Pkac, bzp*, 4:1951368..1965340',
            geneListTip: 'Select gene to show in genome browser. <br>All regions listed in this panel have been appended to the samples panel with normalized read counts.',
            otherTracksTip: 'Mapability shows regions which are not mapable due to repeat sequences.<br>Coverage shows the number of reads mapping to a region.<br>Splice Junctions show reads spanning a known splice junction and alternative splicing.',
            sampleTip:
            '<div class="help_text"><p>This panel shows the list of RNA-seq experiments and the conditions under which RNA was collected.</p> <p>To view the nucleotide coverage for a sample click the sample row. Similar to excel, multiple samples can be selected using the shift+click or ctrl-click. </p> <p>The table can be sorted using the column headers. The dropdown menu for each column header also allows showing/hiding individual columns. </p> <p>The normalized read counts of the search results are appended to this table. The normalization accounts for the difference in total read counts between samples. The "Get Read Counts" button in the browser panel can also be used to add normalized read counts the table.</p><p>The "Export Results" button at the top of the panel saves the table to an excel file.</p></div>',
            browserTip: '<div class="help_text"><p>This panel shows the nucleotide coverage for each selected sample.</p> <p>The first track shows the chromosome location and the gene models. Mouse over genes to see gene names. Click genes to get more information.</p><p>Each selected sample track will appear below the gene model track. Each track is scaled to the maximum coverage over that region. Mouse over the sample coverage track to see the scale. The green bars represents reads mapping to the forward stand, red to the reverse stand and black is the sum of both.</p><p>Additional tracked can be visualized by checking the track boxed under the search panel on the right.</p><p>To highlight a specific region of the genome shift+click and drag over the region. This will result in a popup menu for zooming into the region and getting the normalized read counts. </p> <p>The button as the top of the panel provide navigation. Clicking the button multiple times will magnify the action. The location and region size number will update to reflect the new postion. </p> </div>',
            citation: '<div class="help_text"><p>Parikh A, Miranda ER et al. <a target="_blank"  href="http://genomebiology.com/2010/11/3/R35">Conserved developmental transcriptomes in evolutionary divergent species.</a> Genome Biology 2010, 11(3):R35.</p><p><a target="_blank" href="http://purple.bioch.bcm.tmc.edu/~anup/RNAseq/">Supplement</a></p></div>'
        }
    },
    'dp' : {
        genome_name: 'D. purpureum',
        tracks : {
        'gene_models': {
            name: 'Gene Models',
            id: 'gene_models',
            type: 'genome_tracks',
            always_show: true,
            height: 70,
            func: 'show_gene_models',
            url: 'http://purple.bioch.bcm.tmc.edu/~anup/RNAseq/RNA-seq-browser/ajax/get_tracks1.php',
            additional_params: {
                debug: 0,
                log: 0,
                flank: 0,
                genome:'dp',
                action: 'gene_model_track'
            },
            // popups: [
                // {
                    // name:'DictyExpress',
                    // url: 'http://www.ailab.si/dictyexpress/run/index.php?username=rnaseq&password=rnaseq&gene={DBGENEID}'
                // },
                // {
                    // name:'Dictybase',
                    // icon:'images/dictybase.ico',
                    // url: 'http://dictybase.org/gene/{DBGENEID}'
                // }
            // ],
            order: 1
        },
        'mapability':{
            name: 'Mapability',
            id: 'mapability',
            type: 'genome_tracks',
            label: 'Average Mapability',
            always_show: false,
            height: 30,
            url: 'http://purple.bioch.bcm.tmc.edu/~anup/RNAseq/RNA-seq-browser/ajax/get_tracks1.php',
            additional_params: {
                debug: 0,
                log: 0,
                flank: 0,
                genome:'dp',
                action: 'mapability'
            },
            func: 'show_coverage',
            order: 2
        },
        'summary':{
            name: 'Summary',
            id: 'summary',
            type: 'summary_tracks',
            label: 'Sum of Selected Samples',
            always_show: false,
            height: 50,
            process_function: 'summary',
            additional_params: {
                debug: 0,
                log: 0,
                genome:'dp',
                flank: 0,
                action: 'coverage'
            },
            func: 'show_coverage',
            order: 3
        },
        'coverage':{
            name: 'Coverage',
            id: 'coverage',
            type: 'sample_tracks',
            label: '',
            always_show: false,
            checked: true,
            height: 50,
            func: 'show_coverage',
            url: 'http://purple.bioch.bcm.tmc.edu/~anup/RNAseq/RNA-seq-browser/ajax/get_tracks1.php',
            additional_params: {
                debug: 0,
                log: 0,
                flank: 0,
                genome:'dp',                
                action: 'coverage'
            },
            order: 1
        },
        'splice': {
            name: 'Splice Junctions',
            id: 'splice',
            type: 'sample_tracks',
            label: '',
            always_show: false,
            checked: false,
            func: 'show_splice',
            url: 'http://purple.bioch.bcm.tmc.edu/~anup/RNAseq/RNA-seq-browser/ajax/get_tracks1.php',
            additional_params: {
                debug: 0,
                log: 0,
                flank: 0,
                genome:'dp',            
                action: 'splice'
            },
            order: 2
        }},
        samples: {
            url: 'http://purple.bioch.bcm.tmc.edu/~anup/RNAseq/RNA-seq-browser/ajax/get_tracks1.php',
            additional_params: {
                action: 'get_samples',
                genome:'dp'                
            },
            columns: [
            {
                id: 'Id',
                header: "sample_id",
                width: 75,
                sortable: true,
                dataIndex: 'sample_id'
                
            },
            {
                header: "Strain",
                width: 75,
                sortable: true,
                dataIndex: 'strain'
            },
            {
                header: "Time Point",
                width: 75,
                sortable: true,
                dataIndex: 'time_point'
            },
            {
                header: "Bio Rep",
                width: 75,
                sortable: true,
                dataIndex: 'bio_replicate'
            },
            {
                header: "Tech Rep",
                width: 75,
                sortable: true,
                dataIndex: 'tech_replicate'
            },
            {
                header: "Growth Condition",
                width: 100,
                sortable: true,
                dataIndex: 'growth_condition'
            },
            {
                header: "Cell Type",
                width: 75,
                sortable: true,
                dataIndex: 'cell_type'
            },
            {
                header: "Total Reads",
                width: 75,
                sortable: true,
                dataIndex: 'norm_counts',
                hidden:true
            }]
        },
        search: {
            url: 'http://purple.bioch.bcm.tmc.edu/~anup/RNAseq/RNA-seq-browser/ajax/get_tracks1.php',
            additional_params: {
                action: 'search',
                genome:'dp'                
            },
            columns: [
            {
                id: 'location',
                header: "Location",
                sortable: false,
                dataIndex: 'location'
            }
            ]
        },
        helpText: {
            helpPanel: '<div><ul style="line-height:2em"><li>Click the <img src="images/Information.png" class="tip"/> icons for help.</li><li>A brief <a href="#" id="tutorial">Tutorial</a>.</li><li>Use <a target="_blank" href="http://code.google.com/p/tbrowse/">TBrowse</a> for your own data.</li></div>',
            searchTip: 'Search by gene name, DDB_G, or location (1:1231..12312).<br>Use * as a wildcard character.<br>Examples: Pkac, bzp*, 4:1951368..1965340',
            geneListTip: 'Select gene to show in genome browser. <br>All regions listed in this panel have been appended to the samples panel with normalized read counts.',
            otherTracksTip: 'Mapability shows regions which are not mapable due to repeat sequences.<br>Coverage shows the number of reads mapping to a region.<br>Splice Junctions show reads spanning a known splice junction and alternative splicing.',
            sampleTip:
            '<div class="help_text"><p>This panel shows the list of RNA-seq experiments and the conditions under which RNA was collected.</p> <p>To view the nucleotide coverage for a sample click the sample row. Similar to excel, multiple samples can be selected using the shift+click or ctrl-click. </p> <p>The table can be sorted using the column headers. The dropdown menu for each column header also allows showing/hiding individual columns. </p> <p>The normalized read counts of the search results are appended to this table. The normalization accounts for the difference in total read counts between samples. The "Get Read Counts" button in the browser panel can also be used to add normalized read counts the table.</p><p>The "Export Results" button at the top of the panel saves the table to an excel file.</p></div>',
            browserTip: '<div class="help_text"><p>This panel shows the nucleotide coverage for each selected sample.</p> <p>The first track shows the chromosome location and the gene models. Mouse over genes to see gene names. Click genes to get more information.</p><p>Each selected sample track will appear below the gene model track. Each track is scaled to the maximum coverage over that region. Mouse over the sample coverage track to see the scale. The green bars represents reads mapping to the forward stand, red to the reverse stand and black is the sum of both.</p><p>Additional tracked can be visualized by checking the track boxed under the search panel on the right.</p><p>To highlight a specific region of the genome shift+click and drag over the region. This will result in a popup menu for zooming into the region and getting the normalized read counts. </p> <p>The button as the top of the panel provide navigation. Clicking the button multiple times will magnify the action. The location and region size number will update to reflect the new postion. </p> </div>',
            citation: '<div class="help_text"><p>Parikh A, Miranda ER et al. <a target="_blank"  href="http://genomebiology.com/2010/11/3/R35">Conserved developmental transcriptomes in evolutionary divergent species.</a> Genome Biology 2010, 11(3):R35.</p><p><a target="_blank" href="http://purple.bioch.bcm.tmc.edu/~anup/RNAseq/">Supplement</a></p></div>'

        }
    }
    ,'test' : {
        genome_name:'Your Genome',
        tracks : {
            gene_models:{
                name: 'Gene Models',
                id: 'gene_models',
                type: 'genome_tracks',
                always_show: true,
                height: 70,
                func: 'show_gene_models',
                 url: 'ajax/get.php',
                
                additional_params: {
                    debug: 0,
                    log: 0,
                    flank: 0,
                    action: 'gene_model_track'
                },
                order: 1
            },
            summary:{
                name: 'Summary',
                id: 'summary',
                type: 'summary_tracks',
                label: 'Sum of Selected Samples',
                always_show: false,
                height: 50,
                process_function: 'summary',
                additional_params: {
                    debug: 0,
                    log: 0,
                    flank: 0,
                    action: 'coverage'
                },
                func: 'show_coverage',
                order: 3
            },
            coverage:{
                name: 'Coverage',
                id: 'coverage',
                type: 'sample_tracks',
                label: '',
                always_show: false,
                checked: true,
                height: 50,
                func: 'show_coverage',
                url: 'ajax/get.php',
                additional_params: {
                    debug: 0,
                    log: 0,
                    flank: 0,
                    action: 'coverage'
                },
                order: 1
            }
        },
        samples: {
                url: 'ajax/get.php',
                additional_params: {
                action: 'get_samples',
            },
            columns: [
            {
                id: 'Id',
                header: "sample_id",
                width: 150,
                sortable: true,
                dataIndex: 'sample_id',
                hidden: true
            },
            {
                header: "Filename",
                width: 150,
                sortable: true,
                dataIndex: 'filename'
            }]
        },
        search: {
            url: 'ajax/get.php',
            additional_params: {
                action: 'search'
            },
            columns: [
            {
                id: 'location',
                header: "Location",
                sortable: false,
                dataIndex: 'location'
            }
            ]
        },
        helpText: {
            helpPanel: '<div><ul style="line-height:2em"><li>Click the <img src="images/Information.png" class="tip"/> icons for help.</li><li>A brief <a href="#" id="tutorial">Tutorial</a>.</li><li>Use <a target="_blank" href="http://code.google.com/p/tbrowse/">TBrowse</a> for your own data.</li></div>',
            searchTip: 'Search by gene name, DDB_G, or location (1:1231..12312).<br>Use * as a wildcard character.',
            geneListTip: 'Select gene to show in genome browser. <br>All regions listed in this panel have been appended to the samples panel with normalized read counts.',
            otherTracksTip: 'Mapability shows regions which are not mapable due to repeat sequences.<br>Coverage shows the number of reads mapping to a region.<br>Splice Junctions show reads spanning a known splice junction and alternative splicing.',
            sampleTip:
            '<div class="help_text"><p>This panel shows the list of RNA-seq experiments and the conditions under which RNA was collected.</p> <p>To view the nucleotide coverage for a sample click the sample row. Similar to excel, multiple samples can be selected using the shift+click or ctrl-click. </p> <p>The table can be sorted using the column headers. The dropdown menu for each column header also allows showing/hiding individual columns. </p> <p>The normalized read counts of the search results are appended to this table. The normalization accounts for the difference in total read counts between samples. The "Get Read Counts" button in the browser panel can also be used to add normalized read counts the table.</p><p>The "Export Results" button at the top of the panel saves the table to an excel file.</p></div>',
          browserTip: '<div class="help_text"><p>This panel shows the nucleotide coverage for each selected sample.</p> <p>The first track shows the chromosome location and the gene models. Mouse over genes to see gene names. Click genes to get more information.</p><p>Each selected sample track will appear below the gene model track. Each track is scaled to the maximum coverage over that region. Mouse over the sample coverage track to see the scale. The green bars represents reads mapping to the forward stand, red to the reverse stand and black is the sum of both.</p><p>Additional tracked can be visualized by checking the track boxed under the search panel on the right.</p><p>To highlight a specific region of the genome shift+click and drag over the region. This will result in a popup menu for zooming into the region and getting the normalized read counts. </p> <p>The button as the top of the panel provide navigation. Clicking the button multiple times will magnify the action. The location and region size number will update to reflect the new postion. </p> </div>'
        }
    }
}




visualPanels = {
   Browser: {
        visual: Ext.browser.panel,
        locationGrid: Ext.browser.locationGrid
    },
   	Plot: {
       visual: Ext.plot.panel,
       locationGrid: Ext.plot.locationGrid
   }
  
}

